package cn.com.bluemoon.daps.system.vo;

import cn.com.bluemoon.daps.system.entity.DapSystemBizLine;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author Jarod.Kong
 */
@Data
@ApiModel(description = "业务线")
public class BizLineVo implements Serializable {
    private static final long serialVersionUID = 1L;

    @NotEmpty(message = "业务线名称不可为空")
    @Size(max = 20, message = "业务线名称不超过{max}")
    private String codeName;

    @NotEmpty(message = "业务线编码不可为空")
    @Size(max = 10, message = "业务线编码不超过{max}")
    private String code;

    @Size(max = 50, message = "全称不超过{max}")
    private String fullName;

    @Size(max = 300, message = "说明不超过{max}")
    private String remark;

    @ApiModelProperty(value = "数据负责人，存工号，只一个")
    @NotEmpty(message = "数据负责人不可为空")
    private String dataManager;

    @ApiModelProperty(value = "etl队列名")
    @Size(max = 255)
    private String etlQueueName;

    @ApiModelProperty(value = "创建人")
    private String createBy;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "修改人")
    private String updateBy;

    @ApiModelProperty(value = "最后更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime updateTime;

    public BizLineVo() {
    }

    public BizLineVo(DapSystemBizLine model) {
        BeanUtils.copyProperties(model, this);
    }

    public DapSystemBizLine toModel() {
        DapSystemBizLine bizLine = new DapSystemBizLine();
        BeanUtils.copyProperties(this, bizLine);
        return bizLine;
    }
}
